package com.freemyleft.left.zapp.app;

import android.content.Context;
import android.os.Handler;

/**
 * Created by FreeMyleft on 2017/11/29.
 * 这是一个对外的工具类 所以他都是一些静态方法
 */

public  final class Left {
    public static Configurator init(Context context) {
        Configurator.getInstace()
                .getLeftConfigs()
                .put(ConfigKeys.APPLICATION_CONTEXT, context.getApplicationContext());
        return Configurator.getInstace();
    }

    public static Configurator getConfigurator() {
        return Configurator.getInstace();
    }

    public static <T> T getConfiguration(Object key) {
        return getConfigurator().getConfiguration(key);
    }

    public static Context getApplicationContext() {
        return getConfiguration(ConfigKeys.APPLICATION_CONTEXT);
    }

    public static Handler getHandler() {
        return getConfiguration(ConfigKeys.HANDLER);
    }


    public static void test(){
    }
}
